/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_listediplome")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvListediplome.findAll", query = "SELECT c FROM CvListediplome c"),
    @NamedQuery(name = "CvListediplome.findById", query = "SELECT c FROM CvListediplome c WHERE c.id = :id"),
    @NamedQuery(name = "CvListediplome.findByNomdiplome", query = "SELECT c FROM CvListediplome c WHERE c.nomdiplome = :nomdiplome"),
    @NamedQuery(name = "CvListediplome.findByTypediplome", query = "SELECT c FROM CvListediplome c WHERE c.typediplome = :typediplome")})
public class CvListediplome implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nomdiplome")
    private String nomdiplome;
    @Column(name = "typediplome")
    private String typediplome;
    @Lob
    @Column(name = "infossuplementaire")
    private String infossuplementaire;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvListediplome", fetch = FetchType.LAZY)
    private List<CvListediplometravailleur> cvListediplometravailleurList;

    public CvListediplome() {
    }

    public CvListediplome(Integer id) {
        this.id = id;
    }

    public CvListediplome(Integer id, String nomdiplome) {
        this.id = id;
        this.nomdiplome = nomdiplome;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNomdiplome() {
        return nomdiplome;
    }

    public void setNomdiplome(String nomdiplome) {
        this.nomdiplome = nomdiplome;
    }

    public String getTypediplome() {
        return typediplome;
    }

    public void setTypediplome(String typediplome) {
        this.typediplome = typediplome;
    }

    public String getInfossuplementaire() {
        return infossuplementaire;
    }

    public void setInfossuplementaire(String infossuplementaire) {
        this.infossuplementaire = infossuplementaire;
    }

    @XmlTransient
    @JsonIgnore
    public List<CvListediplometravailleur> getCvListediplometravailleurList() {
        return cvListediplometravailleurList;
    }

    public void setCvListediplometravailleurList(List<CvListediplometravailleur> cvListediplometravailleurList) {
        this.cvListediplometravailleurList = cvListediplometravailleurList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvListediplome)) {
            return false;
        }
        CvListediplome other = (CvListediplome) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvListediplome[ id=" + id + " ]";
    }
    
}
